<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <form>
    <div>
      <input type="text" name="famlilyName" placeholder="姓名">
    </div>
    <div>
      性别<select name="gender">
        <option value="男">男</option>
        <option value="女">女</option>
      </select>
    </div>
    <div>
      是否成年
      <input type="radio" name="adult" value="是"> 是
      <input type="radio" name="adult" value="否"> 否
    </div>
  </form>

  <button>获取表单数据</button>
  <script>
    const btn = document.querySelector('button')
    btn.addEventListener('click', () => {
      const form = document.querySelector('form');
      const fd = new FormData(form);
      const formDataObj = Array.from(fd).reduce((obj, [key, value]) => Object.assign(obj, { [key]: value }), {});
      console.log(formDataObj);
    })
  </script>
</body>

</html>